import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
  },
  {
    path: '/searchResults',
    name: 'searchResults',
    component: () => import("../views/searchResults.vue")
  },
  {
    path: '/privacyPolicy',
    name: 'privacyPolicy',
    component: () => import("../views/privacyPolicy.vue")
  },
  {
    path: '/accountSetting',
    name: 'accountSetting',
    component: () => import("../views/accountSetting.vue")
  },

  {
    path: '/productClass',
    name: 'productClass',
    component: () => import("../views/productClass.vue")
  },
  {
    path: '/productList',
    name: 'productList',
    component: () => import("../views/productList.vue")
  },
  {
    path: '/productDetails',
    name: 'productDetails',
    component: () => import("../views/productDetails.vue")
  },
  {
    path: '/productDetailsPreview/:id',
    name: 'productDetailsPreview',
    component: () => import("../views/productDetailsPreview.vue")
  },
  {
    path: '/serviceCenter',
    name: 'serviceCenter',
    component: () => import("../views/serviceCenter.vue")
  },
  {
    path: '/news',
    name: 'news',
    component: () => import("../views/news.vue")
  },
  {
    path: '/message',
    name: 'message',
    component: () => import("../views/message.vue")
  },
  {
    path: '/recruit',
    name: 'recruit',
    component: () => import("../views/recruit.vue")
  },
  {
    path: '/download',
    name: 'download',
    component: () => import("../views/download.vue")
  },
  {
    path: '/newDetail',
    name: 'newDetail',
    component: () => import("../views/newDetail.vue")
  },
  {
    path: '/login',
    name: 'login',
    component: () => import("../views/login.vue")
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  }
]
const scrollBehavior = () => {
  return { x: 0, y: 0 }
}

const router = new VueRouter({
  routes,
  scrollBehavior
})

export default router
